home *** CD-ROM | disk | FTP | other *** search
/ You're the Director / You're The Director.iso / pc / macf / mger.dir / 00001.ls next >
Encoding:
Text File  |  1995-10-10  |  15.8 KB  |  661 lines

  1. on startMovie
  2.   global max, movielist, limit, splist, reset, letgo, gSound, prev, gCurrentSprite, CurrentAudio, fullscreenG, gRewind, gSpeed, LastButton
  3.   set the preLoadEventAbort to 1
  4.   initsel()
  5.   openXLib("QT.X")
  6.   set LastButton to 0
  7.   set fullscreenG to 0
  8.   set gRewind to 0
  9.   set gSpeed to 1
  10.   set CurrentAudio to 100
  11.   set CurrentAudio to string(CurrentAudio)
  12.   set magcursor to [the number of cast "Clapboard"]
  13.   set the cursor of sprite 1 to magcursor
  14.   set gCurrentSprite to 3
  15.   set prev to 0
  16.   set gSound to 6
  17.   set prev to 0
  18.   set letgo to 0
  19.   set reset to 0
  20.   set the visible of sprite 19 to 0
  21.   set the textSize of field "movie" to 24
  22.   set the textSize of field "name" to 24
  23.   repeat with i = 21 to 45
  24.     puppetSprite(i, 1)
  25.   end repeat
  26.   set the visible of sprite 45 to 0
  27.   initsel()
  28.   set splist to [[195, 211], [195, 294], [195, 377], [443, 211], [443, 294], [443, 377]]
  29.   set limit to 24
  30.   set movielist to []
  31.   hidebar()
  32.   set max to count(movielist)
  33.   when keyDown then globalkey
  34.   repeat with x = 46 to 48
  35.     puppetSprite(x, 1)
  36.     set the visible of sprite x to 0
  37.     puppetSprite(x, 0)
  38.   end repeat
  39.   go("Options")
  40.   updateStage()
  41. end
  42.  
  43. on idle
  44.   preLoadCast()
  45. end
  46.  
  47. on testbut
  48.   global movielist
  49.   if count(movielist) <= 0 then
  50.     repeat with i = 12 to 18
  51.       set the visible of sprite i to 0
  52.     end repeat
  53.   else
  54.     repeat with i = 12 to 18
  55.       set the visible of sprite i to 1
  56.     end repeat
  57.   end if
  58. end
  59.  
  60. on setdef
  61.   repeat with i = 12 to 18
  62.     set the visible of sprite i to 1
  63.   end repeat
  64. end
  65.  
  66. on addbar x
  67.   global letgo, movielist
  68.   if count(movielist) >= 24 then
  69.     exit
  70.   end if
  71.   set letgo to 0
  72.   set yu to string(item 1 of the name of cast the number of cast string(chars(the name of cast the castNum of sprite x, 1, 2) & "s"))
  73.   reset()
  74.   add(movielist, yu)
  75.   set max to count(movielist)
  76.   setbar()
  77. end
  78.  
  79. on showbar
  80.   global movielist, max, limit
  81.   set the visible of sprite 2 to 1
  82.   repeat with i = 21 to 20 + count(movielist)
  83.     set the visible of sprite i to 1
  84.   end repeat
  85.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  86.     set the visible of sprite i to 0
  87.   end repeat
  88.   updateStage()
  89. end
  90.  
  91. on hidebar
  92.   global movielist, max, limit
  93.   if the frame > 18 then
  94.     set the visible of sprite 2 to 0
  95.   end if
  96.   repeat with i = 21 to 20 + limit
  97.     set the visible of sprite i to 0
  98.   end repeat
  99.   updateStage()
  100. end
  101.  
  102. on setbar
  103.   global movielist, max, selected, limit, fullscreenG
  104.   if count(movielist) = 0 then
  105.     repeat with i = 21 to 20 + limit
  106.       set the visible of sprite i to 0
  107.     end repeat
  108.     exit
  109.   end if
  110.   repeat with i = 1 to count(movielist)
  111.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  112.   end repeat
  113.   repeat with i = 1 to count(selected)
  114.     if getAt(selected, i) = 1 then
  115.       if fullscreenG = 0 then
  116.         set the ink of sprite (20 + i) to 4
  117.         puppetSprite(45, 1)
  118.         set the moveableSprite of sprite 45 to 1
  119.         set newsprite to 20 + i
  120.         set the locH of sprite 45 to the locH of sprite newsprite
  121.         set the locV of sprite 45 to the locV of sprite newsprite
  122.         set the ink of sprite 45 to 36
  123.         set the visible of sprite 45 to 1
  124.         set the moveableSprite of sprite 45 to 0
  125.         updateStage()
  126.       end if
  127.       next repeat
  128.     end if
  129.     set the ink of sprite (20 + i) to 0
  130.     updateStage()
  131.   end repeat
  132.   if fullscreenG = 0 then
  133.     showbar()
  134.   end if
  135. end
  136.  
  137. on namesmall
  138.   set x1 to 100
  139.   repeat with i = 1 to 36
  140.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  141.     set the name of cast (i + x1) to string(yur & i mod 6) & "s"
  142.     if (i mod 6) = 0 then
  143.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & "s"
  144.     end if
  145.   end repeat
  146. end
  147.  
  148. on namemov
  149.   set x1 to 136
  150.   repeat with i = 1 to 36
  151.     set yur to numToChar(charToNum("`") + (i / 6) + 1)
  152.     set the name of cast (i + x1) to string(yur & i mod 6) & ".mov"
  153.     if (i mod 6) = 0 then
  154.       set the name of cast (i + x1) to string(numToChar(charToNum(yur) - 1) & "6") & ".mov"
  155.     end if
  156.   end repeat
  157. end
  158.  
  159. on initsp
  160.   global splist
  161.   set splist to []
  162.   set x to 3
  163.   repeat with i = x to x + 5
  164.     add(splist, [the locH of sprite i, the locV of sprite i])
  165.   end repeat
  166. end
  167.  
  168. on reset
  169.   global splist, reset
  170.   if the frame = 56 then
  171.     exit
  172.   end if
  173.   set x to 13
  174.   repeat with i = x to x + 5
  175.     set yu to getAt(splist, i - x + 1)
  176.     set the locH of sprite i to getAt(yu, 1)
  177.     set the locV of sprite i to getAt(yu, 2)
  178.     set the castNum of sprite i to the number of cast string(chars(the name of cast the castNum of sprite i, 1, 2))
  179.     set the ink of sprite i to 0
  180.     updateStage()
  181.   end repeat
  182.   updateStage()
  183. end
  184.  
  185. on playmovn
  186.   set yu to the clickOn
  187.   puppetSprite(48, 1)
  188.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  189.   set the visible of sprite 48 to 1
  190.   set the movieTime of sprite 48 to 0
  191.   set the movieRate of sprite 48 to 1
  192.   set the controller of cast the castNum of sprite 48 to 0
  193.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and the controlDown
  194.     updateStage()
  195.   end repeat
  196.   set the movieTime of sprite 48 to 0
  197.   set the movieRate of sprite 48 to 0
  198.   set the visible of sprite 48 to 0
  199. end
  200.  
  201. on playmovn2
  202.   set yu to the clickOn
  203.   puppetSprite(48, 1)
  204.   set yu to 0
  205.   repeat with i = 1 to count(movielist)
  206.     if getAt(selected, i) = 1 then
  207.       set yu to i
  208.     end if
  209.     if yu <> 0 then
  210.       exit repeat
  211.     end if
  212.   end repeat
  213.   if yu = 0 then
  214.     exit
  215.   end if
  216.   set yu to yu + 20
  217.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  218.   set the visible of sprite 48 to 1
  219.   set the controller of cast the castNum of sprite 48 to 1
  220.   updateStage()
  221.   set the movieTime of sprite 48 to 0
  222.   set the movieRate of sprite 48 to 1
  223.   updateStage()
  224.   repeat while (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown)
  225.     updateStage()
  226.   end repeat
  227.   set the movieTime of sprite 48 to 0
  228.   set the movieRate of sprite 48 to 0
  229.   set the visible of sprite 48 to 0
  230.   updateStage()
  231.   repeat with x = 13 to 18
  232.     set the visible of sprite x to 1
  233.   end repeat
  234.   updateStage()
  235. end
  236.  
  237. on playmovn3
  238.   global prev
  239.   if prev = 1 then
  240.     set yu to the clickOn
  241.     puppetSprite(48, 1)
  242.     set yu to 0
  243.     repeat with i = 1 to count(movielist)
  244.       if getAt(selected, i) = 1 then
  245.         set yu to i
  246.         set the visible of sprite 19 to 1
  247.         repeat with x = 13 to 18
  248.           set the visible of sprite x to 0
  249.         end repeat
  250.         puppetSound(0)
  251.         updateStage()
  252.       end if
  253.       if yu <> 0 then
  254.         exit repeat
  255.       end if
  256.     end repeat
  257.     if yu = 0 then
  258.       set prev to 0
  259.       exit
  260.     end if
  261.     set yu to yu + 20
  262.     set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  263.     set the visible of sprite 48 to 1
  264.     set the controller of cast the castNum of sprite 48 to 1
  265.     updateStage()
  266.     set the movieTime of sprite 48 to 0
  267.     set the movieRate of sprite 48 to 1
  268.     updateStage()
  269.     set prev to 2
  270.   end if
  271.   if (the movieTime of sprite 48 < the duration of cast the castNum of sprite 48) and not (the controlDown) then
  272.     updateStage()
  273.   else
  274.     set prev to 0
  275.     set the movieTime of sprite 48 to 0
  276.     set the movieRate of sprite 48 to 0
  277.     set the visible of sprite 48 to 0
  278.     updateStage()
  279.     set the visible of sprite 19 to 0
  280.     repeat with x = 13 to 18
  281.       set the visible of sprite x to 1
  282.     end repeat
  283.     puppetSound("OPEN.AIF")
  284.     updateStage()
  285.   end if
  286. end
  287.  
  288. on playmovn3Q
  289.   global prev, Clips, Current
  290.   if prev = 1 then
  291.     set yu to the clickOn
  292.     set yu to 0
  293.     repeat with i = 1 to count(movielist)
  294.       if getAt(selected, i) = 1 then
  295.         set yu to i
  296.         set the visible of sprite 19 to 1
  297.         puppetSound(0)
  298.         updateStage()
  299.       end if
  300.       if yu <> 0 then
  301.         exit repeat
  302.       end if
  303.     end repeat
  304.     if yu = 0 then
  305.       set prev to 0
  306.       exit
  307.     end if
  308.     set yu to yu + 20
  309.     set Clips to the fileName of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  310.     set prev to 2
  311.     set Current to 0
  312.     playQTF(Clips, "160,140", 0)
  313.     updateStage()
  314.   else
  315.     set prev to 0
  316.     updateStage()
  317.     set the visible of sprite 19 to 0
  318.     repeat with x = 13 to 18
  319.       set the visible of sprite x to 1
  320.     end repeat
  321.     repeat with x = 3 to 7
  322.       puppetSprite(x, 1)
  323.       set the visible of sprite x to 1
  324.       puppetSprite(x, 0)
  325.     end repeat
  326.     set MovieSeq to 0
  327.     setbar()
  328.     puppetSound("OPEN.AIF")
  329.     updateStage()
  330.   end if
  331. end
  332.  
  333. on playmovn4Q yu
  334.   global k, mm, Current, prev, Clips
  335.   set yu to yu + 20
  336.   set i to chars(the name of cast the castNum of sprite yu, 1, 3)
  337.   set place to getOne(movielist, i)
  338.   set k to place
  339.   set mm to place
  340.   set Clips to the fileName of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  341.   set prev to 2
  342.   set Current to 1
  343.   playQTF(Clips, "160,140", 0)
  344. end
  345.  
  346. on playmovn4 yu
  347.   global k, mm
  348.   set yu to yu + 20
  349.   set i to chars(the name of cast the castNum of sprite yu, 1, 3)
  350.   set place to getOne(movielist, i)
  351.   set k to place
  352.   set mm to place
  353.   set the castNum of sprite 48 to the number of cast string(chars(the name of cast the castNum of sprite yu, 1, 2) & ".MOV")
  354.   set the visible of sprite 48 to 1
  355.   set the controller of cast the castNum of sprite 48 to 1
  356.   updateStage()
  357.   set the movieTime of sprite 48 to 0
  358.   set the movieRate of sprite 48 to 1
  359.   updateStage()
  360. end
  361.  
  362. on initsel
  363.   global selected
  364.   set selected to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  365. end
  366.  
  367. on delset
  368.   global selected, movielist
  369.   if count(movielist) <= 0 then
  370.     exit
  371.   end if
  372.   set sel to countsel()
  373.   if sel = 0 then
  374.     exit
  375.   end if
  376.   set del to []
  377.   repeat with i = 1 to count(movielist)
  378.     if getAt(selected, i) = 1 then
  379.       setAt(movielist, i, 0)
  380.     end if
  381.   end repeat
  382.   put del
  383.   set mv2 to []
  384.   repeat with i in movielist
  385.     if i <> 0 then
  386.       add(mv2, i)
  387.     end if
  388.   end repeat
  389.   set movielist to mv2
  390.   set the visible of sprite 45 to 0
  391.   updateStage()
  392.   initsel()
  393.   setbar()
  394. end
  395.  
  396. on plusset
  397.   global selected, movielist
  398.   if count(movielist) <= 0 then
  399.     exit
  400.   end if
  401.   set sel to countsel()
  402.   if (sel = count(movielist)) or (sel = 0) then
  403.     exit
  404.   end if
  405.   initsel()
  406.   setAt(selected, sel, 1)
  407.   repeat with i = count(movielist) - 1 down to 1
  408.     if getAt(selected, i) = 1 then
  409.       set yut to getAt(movielist, i)
  410.       setAt(movielist, i, getAt(movielist, i + 1))
  411.       setAt(movielist, i + 1, yut)
  412.       deleteAt(selected, count(selected))
  413.       addAt(selected, 1, 0)
  414.       exit repeat
  415.     end if
  416.   end repeat
  417.   setbar()
  418. end
  419.  
  420. on minset
  421.   global selected, movielist
  422.   if count(movielist) <= 0 then
  423.     exit
  424.   end if
  425.   if getAt(selected, 1) = 1 then
  426.     exit
  427.   end if
  428.   set sel to countsel()
  429.   if sel = 0 then
  430.     exit
  431.   end if
  432.   initsel()
  433.   setAt(selected, sel, 1)
  434.   repeat with i = 1 to count(movielist)
  435.     if getAt(selected, i) = 1 then
  436.       set yut to getAt(movielist, i)
  437.       deleteAt(movielist, i)
  438.       add(movielist, i - 1, yut)
  439.       deleteAt(selected, 1)
  440.       add(selected, 0)
  441.       exit repeat
  442.     end if
  443.   end repeat
  444.   setbar()
  445. end
  446.  
  447. on countsel
  448.   repeat with i = 1 to count(selected)
  449.     if getAt(selected, i) = 1 then
  450.       return i
  451.       exit
  452.     end if
  453.   end repeat
  454.   return 0
  455. end
  456.  
  457. on clearall
  458.   global movielist
  459.   set movielist to []
  460.   set the visible of sprite 45 to 0
  461.   initsel()
  462.   setbar()
  463. end
  464.  
  465. on globalkey
  466.   if the key = BACKSPACE then
  467.     delset()
  468.   end if
  469.   if the key = "+" then
  470.     plusset()
  471.   end if
  472.   if the key = "-" then
  473.     minset()
  474.   end if
  475. end
  476.  
  477. on compilemov
  478.   global movielist, comp, k, mm
  479.   if k = 0 then
  480.     puppetSprite(48, 1)
  481.     set k to 0
  482.     set mm to 1
  483.   end if
  484.   if k <> mm then
  485.     set k to mm
  486.     if k <= count(movielist) then
  487.       set i to getAt(movielist, k)
  488.       initsel()
  489.       setAt(selected, k, 1)
  490.       setbar()
  491.       set j to chars(i, 1, 2)
  492.       set the castNum of sprite 48 to the number of cast (j & ".mov")
  493.       set the directToStage of cast the castNum of sprite 48 to 1
  494.       set the visible of sprite 48 to 1
  495.       set the controller of cast the castNum of sprite 48 to 1
  496.       updateStage()
  497.       set the movieTime of sprite 48 to 0
  498.       set the movieRate of sprite 48 to 1
  499.       updateStage()
  500.     else
  501.       set the visible of sprite 48 to 0
  502.       puppetSprite(48, 0)
  503.       set comp to 0
  504.       set k to 0
  505.       go("EndMovie")
  506.     end if
  507.   end if
  508.   if the movieTime of sprite 48 < the duration of cast the castNum of sprite 48 then
  509.     updateStage()
  510.   else
  511.     set the movieRate of sprite 48 to 0
  512.     set mm to mm + 1
  513.   end if
  514. end
  515.  
  516. on compilemovQ
  517.   global movielist, comp, k, mm, prev, Clips, Current, fullscreenG, gSpeed, MovieSeq
  518.   set numb to count(movielist)
  519.   if k = 0 then
  520.     set k to 0
  521.     set mm to 1
  522.   end if
  523.   if k <> mm then
  524.     set k to mm
  525.     if k <= count(movielist) then
  526.       set i to getAt(movielist, k)
  527.       initsel()
  528.       setAt(selected, k, 1)
  529.       if fullscreenG = 0 then
  530.         setbar()
  531.       end if
  532.       set j to chars(i, 1, 2)
  533.       set prev to 2
  534.       set Clips to the fileName of cast (j & ".mov")
  535.       set Current to 1
  536.       set MovieSeq to 1
  537.       if fullscreenG = 0 then
  538.         playQTF(Clips, "160,140", 0)
  539.       else
  540.         playQTF(Clips, "0,0", 1)
  541.       end if
  542.       set mm to mm + 1
  543.       updateStage()
  544.     else
  545.       set comp to 0
  546.       set k to 0
  547.       if fullscreenG = 1 then
  548.         setbarB()
  549.         puppetSprite(48, 1)
  550.         set the visible of sprite 48 to 0
  551.         puppetSprite(48, 0)
  552.         ChangeScreenSize(Clips, "160,140", 1)
  553.       end if
  554.       stopQT()
  555.       go("EndMovie")
  556.     end if
  557.   end if
  558. end
  559.  
  560. on quitmov
  561.   global comp, k, m
  562.   set comp to 0
  563.   set k to 0
  564. end
  565.  
  566. on RunOff
  567.   global gCurrentSprite
  568.   set the editableText of sprite gCurrentSprite to 0
  569.   if gCurrentSprite = 3 then
  570.     set gCurrentSprite to 4
  571.     updateStage()
  572.   else
  573.     set gCurrentSprite to 3
  574.     testbut()
  575.     setdef()
  576.     go("no")
  577.     showbar()
  578.   end if
  579. end
  580.  
  581. on stopMovie
  582.   closeXLib()
  583. end
  584.  
  585. on beginMyMovie
  586.   global myWindow
  587.   if objectp(myWindow) then
  588.     forget(myWindow)
  589.   end if
  590.   set horzOrigin to the stageLeft
  591.   set vertOrigin to the stageTop
  592.   set myWindowRect to rect(horzOrigin, vertOrigin, horzOrigin + 640, vertOrigin + 480)
  593.   set myWindow to window "HelpMovie"
  594.   set the fileName of myWindow to "HELP.DIR"
  595.   set the titleVisible of myWindow to 0
  596.   open(myWindow)
  597.   tell window "HelpMovie"
  598.     go("Gstart")
  599.   end tell
  600. end
  601.  
  602. on finishMovie
  603.   global myWindow
  604.   if objectp(myWindow) then
  605.     forget(myWindow)
  606.   end if
  607. end
  608.  
  609. on MovieOver
  610.   global myWindow
  611.   set myWindow to window "HelpMovie"
  612.   set the fileName of myWindow to "HELP.DIR"
  613.   close(myWindow)
  614.   forget(myWindow)
  615. end
  616.  
  617. on showbarB
  618.   global movielist, max, limit
  619.   set the visible of sprite 2 to 1
  620.   repeat with i = 21 to 20 + count(movielist)
  621.     set the visible of sprite i to 1
  622.   end repeat
  623.   repeat with i = 20 + count(movielist) + 1 to 20 + limit
  624.     set the visible of sprite i to 0
  625.   end repeat
  626. end
  627.  
  628. on setbarB
  629.   global movielist, max, selected, limit, Double
  630.   put "inside setbar"
  631.   if count(movielist) = 0 then
  632.     repeat with i = 21 to 20 + limit
  633.       set the visible of sprite i to 0
  634.     end repeat
  635.     exit
  636.   end if
  637.   repeat with i = 1 to count(movielist)
  638.     set the castNum of sprite (20 + i) to the number of cast string(getAt(movielist, i))
  639.   end repeat
  640.   repeat with i = 1 to count(selected)
  641.     if getAt(selected, i) = 1 then
  642.       if Double = 0 then
  643.         set the ink of sprite (20 + i) to 4
  644.         put "above puppetSprite 45 is true"
  645.         puppetSprite(45, 1)
  646.         set the moveableSprite of sprite 45 to 1
  647.         set newsprite to 20 + i
  648.         set the locH of sprite 45 to the locH of sprite newsprite
  649.         set the locV of sprite 45 to the locV of sprite newsprite
  650.         set the visible of sprite 45 to 1
  651.         set the moveableSprite of sprite 45 to 0
  652.       end if
  653.       next repeat
  654.     end if
  655.     set the ink of sprite (20 + i) to 0
  656.   end repeat
  657.   if Double = 0 then
  658.     showbarB()
  659.   end if
  660. end
  661.